#include "Node.hpp"
#include "Edge.hpp"

Node::Node()
{
}

Node::~Node()
{
}

const std::string& Node::getName() const
{
  return this->name;
}

int Node::getDegree() const
{
  return this->edges.size();
}

int Node::getInDegree() const
{
  int count = 0;
  for(std::vector< boost::reference_wrapper< const Edge > >::const_iterator it = this->edges.begin(); it != this->edges.end(); ++it)
    {
      if(it->get().second.get_pointer() == this)
	++count;
    }
  return count;
}

int Node::getOutDegree() const
{
  int count = 0;
  for(std::vector< boost::reference_wrapper< const Edge > >::const_iterator it = this->edges.begin(); it != this->edges.end(); ++it)
    {
      if(it->get().first.get_pointer() == this)
	++count;
    }
  return count;
}
